import request from "@/utils/request";

/**
 * @function 获取定时任务列表
 * **/
export const listApi = (params) => {
  return request.get('/sys/schedule/page', {params})
}

/**
 * @function 创建定时任务
 * **/
export const createApi = (data) => {
  return request.post('/sys/schedule', data)
}

/**
 * @function 定时任务详情
 * **/
export const getInfoApi = (id) => {
  return request.get(`/sys/schedule/${id}`)
}

/**
 * @function 更新任务详情
 * **/
export const updataApi = (data) => {
  return request.put(`/sys/schedule`, data)
}

/**
 * @function 删除定时任务
 * **/
export const deleteApi = (ids) => {
  return request.delete('/sys/schedule', {data:ids})
}

/**
 * @function 执行定时任务
 * **/
export const runScheduleApi = (ids) => {
  return request.put('/sys/schedule/run', ids)
}

/**
 * @function 暂停定时任务
 * **/
export const pauseScheduleApi = (ids) => {
  return request.put('/sys/schedule/pause',ids)
}

/**
 * @function 恢复定时任务
 * **/
export const resumeScheduleApi = (ids) => {
  return request.put('/sys/schedule/resume',ids)
}

/**
 * @function 定时任务日志page
 * **/
export const scheduleLogApi = (params) => {
  return request.get('/sys/scheduleLog/page', {params})
}